package com.qf.controller;

import com.qf.pojo.DtsUserAccount;
import com.qf.service.DtsAdminService;
import com.qf.service.DtsUserAccountService;
import com.qf.service.DtsUserService;
import com.qf.util.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/admin/user")
public class DtsAdminUserController {

    @Autowired
    DtsUserService userService;
    @Autowired
    DtsUserAccountService dtsUserAccountService;
    @GetMapping("/detailApprove")
    public Object detailApprove(Integer id){
        DtsUserAccount data = dtsUserAccountService.detailApprove(id);
        return ResponseUtil.ok(data);
    }

    @GetMapping("/list")
    public Object list(
            @RequestParam(value = "page",required = false, defaultValue = "1") Integer page,
            @RequestParam(value = "limit",required = false, defaultValue = "20")Integer limit,
            String username,String mobile,String sort,String order){
        Map<String,Object> data = userService.queryPage(page,limit,username,mobile,sort,order);

        return ResponseUtil.ok(data);
    }
}